* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
body {
	height: 100vh;
	display: flex;
}

.container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gameContainer {
	width: 600px;
	height: 600px;
	margin: auto;
	display: flex;
	flex-wrap: wrap;
	perspective: 1000px;
}

.bg-img {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: -99999;
}

.memoryCard {
	width: 23%;
	height: 23%;
	margin: 5px;
	position: relative;
	transform-style: preserve-3d;
	transition: transform 0.3s;
  animation-duration: 0.3s;
  border-radius : 10px;
  box-shadow: 5px 10px 10px 0 rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

.memoryCard:active {
	transform: scale(0.95);
	transition: transform 0.2s ease-in-out;
}

.memoryCard.flip {
		transform: rotateY(180deg);
		cursor: pointer;
	}

.front, .back {
  background-color: white;
  width: 100%;
  height: 100%;
  border: 2px solid black;
  border-radius : 10px;
  position: absolute;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.front{
	transform: rotateY(180deg);
}

embed {
  position: absolute;
  visibility: hidden;
}

/** Game finished **/
.completed {
  width: inherit;
  height: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  z-index: 999;
  background: rgba(0,0,0,0.6);
}

.completed > div {
  font-size: 1.5em;
  text-align: center;
  margin: 0;
}

.completed > div:first-child {
  font-size: 3em;
  font-weight: 700;
  color: red;
}

.completed .img-group > img {
  width: 1200px;
  height: 500px;
}

.completed .img-group {
  position: relative;
}

img.auspicious-word {
  position: absolute;
  width: 1000px;
  height: 360px;
  z-index: 9999999;
  opacity: 0;
  animation: text-animation 2.5s forwards;
}

img.auspicious-word {
  top: 70px;
  left: 120px;
}


button {
  width: 70px;
  height: 40px;
  background: rgb(241, 33, 137);
  border: none;
  border-radius: 10px;
  font-weight: bolder;
  cursor: pointer;
}

button:hover {
  background-color: rgba(241, 23, 52, 0.945);
  transition: all 0.2s ease-out;
}

.d-none {
  display: none;
}


@keyframes text-animation {
  30% {
    transform: translate(0, 10px) scale(1);
  }
  
  60% {
    transform: translate(0, 20px) scale(.8) rotate(0deg);
  }

  100% {
    bottom: 0;
    opacity: 1;
  }
}

@media screen and (max-width: 1025px) {
  .container {
    height: 100%;
  }

  .gameContainer {
    width: 600px;
    height: 500px;
  }

  .img-group img.complete-book {
    width: 950px;
    height: 450px;
  }

  img.auspicious-word {
    width: 800px;
    height: 300px;
  }

  img.auspicious-word {
    top: 65px;
    left: 95px;
  }
}


@media screen and (max-width: 767px) {
  .container {
    height: 100%;
   
  }

  .gameContainer {
    width: 400px;
    height: 400px;
    place-content: center;
  }

  .img-group img.complete-book {
    width: 380px;
    height: 400px;
  }

  img.auspicious-word {
    width: 340px;
    height: 250px;
  }

  img.auspicious-word {
    top: 75px;
    left: 30px;
  }
}
